package org.oep.game;

public class Camera {
	private int x, y, subjectX, subjectY;
	private double interpolationFactor = 1.0;
	
	public void interpolate() {
		x += (subjectX - x) * interpolationFactor;
		y += (subjectY - y) * interpolationFactor;
	}
	
	public int getX() {
		return x;
	}
	
	public int getY() {
		return y;
	}
	
	public int getSubjectX() {
		return subjectX;
	}
	
	public int getSubjectY() {
		return subjectY;
	}
	
	public double getInterpolationFactor() {
		return interpolationFactor;
	}
	
	public void setPosition(int a, int b) {
		x = a;
		y = b;
	}
	
	public void setSubjectPosition(int a, int b) {
		subjectX = a;
		subjectY = b;
	}
	
	public void setInterpolationFactor(double d) {
		if(d > 0 && d <= 1)
			interpolationFactor = d;
	}
}
